import {Link} from "react-router";
import "./index.css";
import {Button, ButtonToolbar, Navbar, Nav, Anchor} from "../../rsuite";
import Lang from "../../libs/i18";

var MenuItem = React.createClass({
    render() {
        return <Link to={this.props._to.to} className='nav_item'>{this.props._to.label}</Link>;
    }
});
export default class MainMenu extends React.Component {

    render() {
        const menus = [
            {label: '主题', to: 'home'},
            {label: '班级', to: 'todo'},
            {label: '登录', to: 'login'},
            {label: '设备', to: 'home'},
            {label: '统计', to: 'home'},
            {label: '全局', to: 'home'},
            {label: '系统', to: 'home'},
            {label: '其他', to: 'home'},
        ];

        const menu_item = menus.map((item, index) =>
            <li key={'submenu' + index.toString()}><MenuItem _to={item}/></li>);
        return (
            <Navbar inverse style={{marginBottom: 0}}>
                <Navbar.Header>
                    <Navbar.Brand>
                        <div href="#">{Lang.nav.brand}</div>
                    </Navbar.Brand>
                    <Navbar.Toggle />
                </Navbar.Header>
                <Navbar.Collapse>
                    <Nav pullRight>
                        <Nav.Item eventKey={1} href="#">中文</Nav.Item>
                        <Nav.Item eventKey={2} href="#">英文</Nav.Item>
                        <Nav.Item eventKey={2} href="#">维语</Nav.Item>
                        <Nav.Dropdown eventKey="E" select title="苏伟明">
                            <Nav.Item eventKey="E-1">个人资料</Nav.Item>
                            <Nav.Item eventKey="E-2">意见反馈</Nav.Item>
                            <Nav.Item eventKey="E-3">退出系统</Nav.Item>
                        </Nav.Dropdown>
                    </Nav>
                </Navbar.Collapse>
            </Navbar>
        );
    }
}
